<?php
namespace app\admin\controller;
use app\admin\controller\Base;//权限验证
use think\Loader;
use think\Session;
use think\Db;
class Produce extends Base{	
    public function index(){
		$list=Db::name('produce')			
		->order('pid','desc')
		->paginate(8);
		// $list = $li->paginate(8);	
		// var_dump($list);
		// exit;
		$page=$list->render();
		$this->assign('list',$list);		
		$this ->assign('page',$page);		
		return $this->fetch('list');		
	}	
	public function del(){
		$pid=input('pid');
		if(db('Produce')->delete($pid)){
			$this->success('删除文章成功！','index');
		}else{
			$this->error('删除文章失败！');
		}
	}
}              